package xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.presenter;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;

import java.util.ArrayList;
import java.util.List;

import xixirupan.tmgp.tencent.com.vmeim.ui.beautyshop.model.CategoryBiz;

/**
 * Created by lenovo on 2016/10/19.
 */

public class CategoryPresenter {
    private RecyclerView recyclerView;
    RecycleCategoryAdapter adapter;
    Context context;
    LayoutInflater inflater;
    List<Object> lists =new ArrayList<>();
    CategoryBiz bizbean;
  public CategoryPresenter(final RecyclerView recyclerView, final Context context, final LayoutInflater inflater)
  {
      this.recyclerView =recyclerView;
      this.context =context;
      this.inflater =inflater;

      bizbean =new CategoryBiz();
     bizbean.getData(new CategoryBiz.GetDataListListener() {
         @Override
         public void getDataListener(List<Object> _lists) {
             lists.addAll(_lists);

             adapter =new RecycleCategoryAdapter(context,inflater,lists);
             LinearLayoutManager manager =new LinearLayoutManager(context,LinearLayoutManager.VERTICAL,false);
             recyclerView.setLayoutManager(manager);
             recyclerView.setAdapter(adapter);
             Log.i("TAG","------------>>>>>"+lists.size());

         }
     });



  }

}
